﻿@page
@model ASP.NET_Core_RazorStripe1.Pages.Contacts.IndexModel

@{
    ViewData["Title"] = "Index";
}

<h1>Index</h1>

<p>
    <a asp-page="Create">Create New</a>
</p>
<table class="table">
    <thead>
        <tr>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].FirstName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].LastName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].CompanyName)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].Title)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].Phone)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].EmailAddress)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].Details)
            </th>
            <th>
                @Html.DisplayNameFor(model => model.Contact[0].Status)
            </th>
            <th></th>
        </tr>
    </thead>
    <tbody>
@foreach (var item in Model.Contact) {
        <tr>
            <td>
                @Html.DisplayFor(modelItem => item.FirstName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.LastName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.CompanyName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Title)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Phone)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.EmailAddress)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Details)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Status)
            </td>
            <td>
                <a asp-page="./Edit" asp-route-id="@item.ContactId">Edit</a> |
                <a asp-page="./Details" asp-route-id="@item.ContactId">Details</a> |
                <a asp-page="./Delete" asp-route-id="@item.ContactId">Delete</a>
            </td>
        </tr>
}
    </tbody>
</table>
